package site.anxuan.seckill.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 用户实体类
 *
 * @author 黯玄
 * @since v1.0
 */
@Data
@ToString
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class User {

    /** 主键 */
    private Integer id;

    /** 手机号 */
    @NotBlank(message = "手机号不能为空")
    private String phone;

    /** 昵称 */
    @NotBlank(message = "昵称不能为空")
    private String nickName;

    /** 密码 */
    @NotBlank(message = "密码不能为空")
    private String password;

    @NotNull(message = "性别不能为空")
    private Integer gender;

    @NotNull(message = "年龄不能为空")
    @Min(value = 1, message = "年龄不能小于1")
    @Max(value = 200, message = "年龄不能超过200")
    private Integer age;

}
